package dao;

import model.Rating;
import org.hibernate.Session;
import org.hibernate.Transaction;
import util.HibernateUtil;

/**
 * Created by VLAD on 07.07.2014.
 */
public class RatingDao implements IRatingDao {
    public long saveRatio(Rating rating)
    {
        Session session = HibernateUtil.getSessionFactory().getCurrentSession();
        Transaction tx = null;
        Long ratingID = null;
        tx = session.beginTransaction();
        ratingID = (Long)session.save(rating);
        tx.commit();
        return ratingID;

    }
}
